﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data.SqlClient;
using System.Windows.Forms;

namespace Manage_Pupils
{
    class Connection
    {
        private String sqlConnect = "Data Source=192.168.1.200,1433;server=IWANTWIN-PC; user id=sa; password=123456; database=QuanLyHocSinh; Connection Timeout=15";
        public SqlConnection con;

        public void Connect() {
            try
            {
                con = new SqlConnection(sqlConnect);
                con.Open();
                //MessageBox.Show("Kết nối thành công!");
            }
            catch (Exception e) {
                MessageBox.Show("Connect failed"+e.ToString(),"Error",MessageBoxButtons.OK);
            }
        }

        public void DisConnect(){
            con.Close();
            con.Dispose();
        }
    }
}
